import request from '@/utils/request'

/**
 * 获取用户列表数据
 */
export const getRoleList = () => {
  return request({
    url: '/sys/role/list'
  })
}

export const addRole = data => {
  return request({
    url: '/sys/role/save',
    method: 'POST',
    data
  })
}

export const updateRole = data => {
  return request({
    url: '/sys/role/update',
    method: 'POST',
    data
  })
}

export const roleTree = data => {
  return request({
    url: '/sys/role/roleTree',
    method: 'POST',
    data
  })
}

export const changeAcls = data => {
  return request({
    url: '/sys/role/changeAcls',
    method: 'POST',
    data
  })
}

export const changeUsers = data => {
  return request({
    url: '/sys/role/changeUsers',
    method: 'POST',
    data
  })
}

export const getRoleUsers = data => {
  return request({
    url: '/sys/role/users',
    method: 'POST',
    data
  })
}

export const getRolesByUserId = data => {
  return request({
    url: '/sys/role/getRolesByUserId',
    method: 'POST',
    data
  })
}

export const updateRoleUsers = data => {
  return request({
    url: '/sys/role/updateRoleUsers',
    method: 'POST',
    data
  })
}
